package com.dys.testjdk15;

/**
 * @className: com.dys.testjdk15.TestRecords
 * @description: com.dys.testjdk15
 * @author: pine cone
 * @version: v1.0.0
 * @createTime: 2024/09/09 下午9:26
 */
public class TestRecords {
}

/*
 * 只有接口可以继承接口
 * 一个接口可以同时继承多个接口
 * final不能修饰接口,密封接口在被继承时,子接口要么使用 sealed non sealed  修饰
 * */
sealed interface MyInter1 permits MyInter3 {
}

sealed interface MyInter2 permits MyInter3 {
}

sealed interface MyInter3 extends MyInter1, MyInter2 {
}

non-sealed class MyImpl implements MyInter3 {
}


sealed interface I permits A, B, C {
}

final class A implements I {
}

sealed class B implements I {
}

non-sealed class C implements I {
}

final class D extends B {
}